
namespace ItProject.Andir.Cryptography
{
	/// <summary>
	/// Represent the base interface for implementation of block HashAlgoritm.
	/// </summary>
	public interface IBlockHashAlghorithmImpl
	{
		/// <summary>
		/// Size of block for processing by algorithm
		/// </summary>
		/// <value>integer value of block size in bytes (ex.: 64, 128)</value>
		int BlockSize
		{
			get;
		}

		/// <summary>
		/// Initialization of algorithm state  
		/// </summary>
		void Initialize();

		/// <summary>
		/// Processing block of bytes (size is @BlockSize), @array length must be >= than @offset + @BlockSize
		/// </summary>
		/// <param name="array">array of bytes</param>
		/// <param name="offset">offset from begin of block in @array</param>
		void ProcessBlock(byte[] array, int offset);

		/// <summary>
		/// Processing final block of bytes (size is @length), @array length must be >= than @offset + @length
		/// </summary>
		/// <param name="array">array of bytes</param>
		/// <param name="offset">offset from begin of block in @array</param>
		/// <param name="length">length of final block</param>
		void ProcessFinalBlock(byte[] array, int offset, int length);

		/// <summary>
		/// Resulting value of algorithm
		/// </summary>
		/// <value>byte array with hash value</value>
		byte[] Result
		{
			get;
		}
	}
}
